home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
C++ Files Library
/
Point_Rect C++ Classes
/
MacObj.sit
/
MacObj ƒ
/
CPoint.note
< prev
next >
Wrap
Text File
|
1993-09-15
|
2KB
|
74 lines
class CPoint : public Point
The CPoint class is based on the Macintosh Point structure and includes
methods that operate on CPoint and Point structures. A CPoint object can
be used wherever a Point structure is used.
The Macintosh Point structure is defined as:
struct Point {
short v;
short h;
};
To use this class include the header file CPoint.h.
Constructors:
CPoint();
Constructs a CPoint object. v and h are not initialized.
CPoint(short inith, short initv);
Constructs a CPoint object. Initializes v and h to initv and inith
respectively.
CPoint(Point p);
Constructs a CPoint object. Initializes v and h to the corresponding
values of Point p.
Member functions:
void Offset(short hoffset, short voffset);
Offsets (adds to) CPoint by hoffset and voffset.
void Offset(Point p);
Offsets CPoint by the amount specified by Point p.
void Move(void);
Quickdraw Move. Moves the pen in the current grafport by the distances
specified by the CPoint.
void MoveTo(void);
Quickdraw MoveTo. Moves the pen to the specified point.
void Line(void);
Quickdraw Line. Moves the pen in the current grafport by the distances
specified by the CPoint. Draws a line as it moves.
void LineTo(void);
Quickdraw LineTo. Draws a line to the specified point.
Operators:
Boolean operator==(Point p) const;
Returns true if CPoint is equal to p.
Boolean operator!=(Point p) const;
Returns true if CPoint is not equal to p.
void operator+=(Point p);
Offsets CPoint by p.
void operator-=(Point p);
Subtracts p for CPoint (negative offset).
CPoint operator+(Point p) const;
Returns a CPoint that is offset by p.
CPoint operator-(Point p) const;
Returns a CPoint that is offset by negative p.
CPoint operator-() const;
Returns a negative CPoint.